package com.shop.user.api.api;

import com.shop.common.entity.user.UserBase;
import com.shop.common.util.excption.UserNotFoundException;
import com.shop.user.api.model.RestModel;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @Description:
 *
 * @author zhoulk
 * @date: 2019年03月29日  23:49
 */

@RequestMapping("/user/")
public interface IUserApi {

    /**
     * @Function com.shop.user.api.api.IUserApi.simpleUser
     * @Description //TODO 查询用户简单信息
     *
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/29 23:58
     *
     **/
    @GetMapping("simpleUser")
    String simpleUser(HttpServletRequest request) throws Exception;

    @GetMapping("/user/{userId}")
    String qryUserById(@PathVariable(value = "userId")Integer userId);

    /**
     * @Function com.shop.user.api.api.IUserApi.apiGetUser
     * @Description //TODO 查询用户信息
     *
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/29 23:59
     *
     **/
    @GetMapping("user")
    String apiGetUser(HttpServletRequest request) throws UserNotFoundException;

    /**
     * @Function com.shop.user.api.api.IUserApi.apiUpdateUser
     * @Description //TODO 更新用户信息
     *
     * @param: userBase
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/29 23:59
     *
     **/
    @PutMapping("user")
    String apiUpdateUser(@RequestBody UserBase userBase, HttpServletRequest request) throws UserNotFoundException;

    /**
     * @Function com.shop.user.api.api.IUserApi.apiRestPwd
     * @Description //TODO 修改登陆密码
     *
     * @param: restModel
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/29 23:59
     *
     **/
    @PutMapping("password")
    String apiRestPwd(@RequestBody RestModel restModel, HttpServletRequest request) throws UserNotFoundException;

    /**
     * @Function com.shop.user.api.api.IUserApi.apiHasOldPayPwd
     * @Description //TODO 获取用户旧密码
     *
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/29 23:59
     *
     **/
    @GetMapping("hasPaypwd")
    String apiHasOldPayPwd(HttpServletRequest request) throws UserNotFoundException;

    /**
     * @Function com.shop.user.api.api.IUserApi.apiQryPhone
     * @Description //TODO 获取用户手机
     *
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/29 23:59
     *
     **/
    @GetMapping("phone")
    String apiQryPhone(HttpServletRequest request) throws UserNotFoundException;

    /**
     * @Function com.shop.user.api.api.IUserApi.apiQryEmail
     * @Description //TODO 获取用户邮箱
     *
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/29 23:59
     *
     **/
    @GetMapping("email")
    String apiQryEmail(HttpServletRequest request) throws UserNotFoundException;

    /**
     * @Function com.shop.user.api.api.IUserApi.apiRestPayPwd
     * @Description //TODO 修改支付密码
     *
     * @param: restModel
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/30 0:00
     *
     **/
    @PutMapping("payPassword")
    String apiRestPayPwd(@RequestBody RestModel restModel, HttpServletRequest request) throws UserNotFoundException;

    /**
     * @Function com.shop.user.api.api.IUserApi.apiRestPhoneVerify
     * @Description //TODO 获取手机或者邮箱验证码
     *
     * @param: phone
     * @param: type 类型：1-手机，2-邮箱
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/30 0:00
     *
     **/
    @GetMapping("restVerify")
    String apiRestPhoneVerify(String phone, Integer type, HttpServletRequest request);

    /**
     * @Function com.shop.user.api.api.IUserApi.apiRestPhone
     * @Description //TODO 修改用户手机号
     *
     * @param: restModel
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/30 0:00
     *
     **/
    @PutMapping("/phone")
    String apiRestPhone(@RequestBody RestModel restModel, HttpServletRequest request) throws UserNotFoundException;

    /**
     * @Function com.shop.user.api.api.IUserApi.apiValidateIdcard
     * @Description //TODO 实名认证
     *
     * @param: restModel
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/30 1:03
     *
     **/
    @PostMapping("/validateIdcard")
    String apiValidateIdcard(@RequestBody RestModel restModel, HttpServletRequest request) throws UserNotFoundException;

    /**
     * @Function com.shop.user.api.api.IUserApi.validatePayPwd
     * @Description // 校验支付密码
     *
     * @param: pwd
     * @param: request
     * @return java.lang.String
     * @errorCode //
     *
     * @Author zhoulk
     * @Date 2019/5/10 18:50
     *
     **/
    @GetMapping("/validate/paypwd/{pwd}")
    String validatePayPwd(@PathVariable(value = "pwd")String pwd,HttpServletRequest request) throws UserNotFoundException;

    @GetMapping("/security")
    String userSecurity(HttpServletRequest request) throws UserNotFoundException;

    @GetMapping("/quit")
    String userQuit(HttpServletRequest request);
}
